const { DataTypes } = require("sequelize");
const seq = require("../db/seq.js");
const Opticals = seq.define(
  "boxes",
  {
    ID: {
      type: DataTypes.INTEGER,
      allowNull: false,
      autoIncrement:true,
      primaryKey: true,
      comment: "接头盒ID",
    },
    BoxID: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue:'',
      comment: "接头盒ID",
    },
    BoxName: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "接头盒名称",
    },
    linkId: {
      type: DataTypes.INTEGER,
      allowNull: false,
      defaultValue: 0,
      comment: "线路ID",
    },
    BoxCode: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "接头盒编号",
    },
    Runtime: {
      type: DataTypes.STRING(10),
      allowNull: false,
      defaultValue: 0,
      comment: "运行时间",
    },
    cdate: {
      type: DataTypes.STRING(30),
      allowNull: false,
      defaultValue: "",
      comment: "接入时间",
    },
    Longitude: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "经度",
    },
    Latitude: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "纬度",
    },
    Z: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "Z坐标",
    },
    dataFlag:{
      type:DataTypes.TINYINT,
      allowNull:false,
      defaultValue:1,
      comment:"删除标志"
    }
  },
  {
    freezeTableName: true,
    timestamps: false,
  }
);
module.exports = Opticals;